<extend name="Base/base" />
<block name='head'>
    <link rel="stylesheet" type="text/css" href="/Public/Admin/css/kaoqin.css"/>
    <link rel="stylesheet" type="text/css" href="/Public/Admin/css/main.css"/>
</block>
<block name="content" >
    <section class="layui-larry-box mian-page page-attendanceStatistics">
        <div class="larry-personal">
            <div class="layui-tab">
                <blockquote class="layui-elem-quote news_search">
                    <form method="get" id='form'>
                        <div class="layui-inline">
                            <span class="btn-upload form-group">
                                <select name="is_read" class="layui-input search_input" >
                                    <option value="">读取状态</option>
                                    <option value="1" {$is_read == 1?'selected':''}>未读</option>
                                    <option value="2" {$is_read == 2?'selected':''}>已读</option>
                                </select>
                            </span>
                        </div>
                        <div class="layui-inline">
                            <span class="btn-upload form-group">
                                <select name="from_id" class="layui-input search_input" >
                                    <option value="">发布人</option>
                                    <foreach name="notice_users" item="user">
                                        <option value="{$user.user_id}" {$from_id == $user['user_id'] ? 'selected' : ''}>{$user.user_name}</option>
                                    </foreach>
                                </select>
                            </span>
                        </div>
                        <div class="layui-inline">
                            <span class="btn-upload form-group">
                                <select name="type_id" class="layui-input search_input">
                                    <option value="">类型</option>
                                    <foreach name="notice_code" item="code">
                                        <option value="{$code.code_no}" {$type_id == $code['code_no'] ? 'selected' : ''}>{$code.code_name}</option>
                                    </foreach>
                                </select>
                            </span>
                        </div>
                        <div class="layui-inline">
                            <span class="btn-upload form-group">
                                <input type="text" name="subject" placeholder="标题" value="{$subject}" class="layui-input search_input">
                            </span>
                        </div>
                        <div class="layui-inline">
                            <span class="btn-upload form-group">
                                <input type="text" name="send_time" placeholder="发布日期" value="{$send_time}" class="layui-input search_input datepickerInput">
                            </span>
                        </div>
                        <div class="layui-inline">
                            <span class="btn-upload form-group">
                                <input type="text" name="content" placeholder="内容" value="{$content}" class="layui-input search_input">
                            </span>
                        </div>
                        <a class="layui-btn search_btn search" data-url="{:U('notice')}" style="margin-left:10px;"> 查询</a>
                        <a class="layui-btn search_btn newEmail" style="margin-left:10px;" target="_blank"> 新邮件（{$newCount}）</a>
                        <input type='hidden' id='loginEmail' value="{:U('loginEamil')}">
                        <!--<a class="layui-btn search_btn" data-url="{:U('notice')}" style="margin-left:10px;"> 重置</a>-->
                        <!--<button type="reset" class="layui-btn search_btn reset">重置</button>-->
                        <input type="hidden" name="p" value="1" />
                    </form>
                </blockquote>

                <div class="layui-tab-content larry-personal-body clearfix mylog-info-box tabRedefine layui-tab-brief">
                    <div class="layui-tab-item layui-field-box layui-show absence">
                        <table class="layui-table setTabBg out" lay-skin="line">
                            <thead>
                                <tr>
                                    <th>发布人</th>
                                    <th>类型</th>
                                    <th>标题</th>
                                    <th width='20%'>发布范围</th>
                                    <th>生效日期</th>
                                </tr>
                            </thead>
                            <tbody>
                            <notempty>
                                <foreach name='notify' item='data'>
                                    <tr>
                                        <td>{$data.from_id|getChineseName}</td>
                                        <td>{$data.type_id|getNoticeTypeName}</td>
                                        <td>
                                            <a href='{:U("readNotify",array("notify_id"=>$data["notify_id"],"is_read"=>$_GET["is_read"],"from_id"=>$_GET["from_id"],"type_id"=>$_GET["type_id"],"subject"=>$_GET["subject"],"send_time"=>$_GET["send_time"],"content"=>$_GET["content"]))}' style="color:#1781d0;">
                                                {$data.subject}
                                                <if condition='$data["is_read"] eq 1'>
                                                    <img src="/Public/Admin/images/new.gif"/>
                                                </if>
                                            </a>
                                        </td>
                                        <td align='left'>
                                            <font style="color:#1781d0;font-weight:bolder;">部门：</font>{$data.to_id}<br>
                                    <if condition="$data['priv_id'] neq ''">
                                        <font style="color:#1781d0;font-weight:bolder;">角色：</font>{$data.priv_id}<br>
                                    </if>
                                    <if condition="$data['user_id'] neq ''">
                                        <font style="color:#1781d0;font-weight:bolder;">人员：</font>{$data.user_id}<br>
                                    </if>
                                    </td>
                                    <td>{$data.begin_date}</td>
                                    <tr>
                                </foreach>
                            </notempty>
                            </tbody>
                        </table>
                    </div>
                    <div class="layui-block">共{$count}条数据</div>
                    <div class="larry-table-page clearfix">
                        <div id="page" class="page">{$page}</div>
                    </div>
                </div>
            </div>
        </div>
    </section>
</block>
<block name="script">
    <script type="text/javascript" src="/Public/Admin/js/common.js"></script>
    <script type="text/javascript" src="/Public/Admin/js/personal.js"></script>
    <script type="text/javascript">
        $(initPersonal());
        $(dateTime(0));
    </script>
</block>